class Solution(object):
    def consecutiveNumbersSum(self, n):
        """
        :type n: int
        :rtype: int
        """
        n_max = int((2 * n + 0.25) ** 0.5 - 0.5)
        t = 0
        for i in range(1, n_max + 1):
            value = n / i + (1 - i) / 2
            if value == int(value):
                t += 1
        return t

data = Solution()
n = 10
print(data.consecutiveNumbersSum(n))
